{{- include "helm_lib_csi_controller_rbac" . }}

---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: csi:controller:controller
  namespace: d8-{{ .Chart.Name }}
{{ include "helm_lib_module_labels" (list . (dict "app" "csi-controller")) | indent 2 }}
rules:
- apiGroups: [""]
  resources: ["configmaps"]
  verbs: ["get", "list", "watch", "create","update", "delete"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: csi:controller:controller
  namespace: d8-{{ .Chart.Name }}
{{ include "helm_lib_module_labels" (list . (dict "app" "csi-controller")) | indent 2 }}
subjects:
- kind: ServiceAccount
  name: csi
  namespace: d8-{{ .Chart.Name }}
roleRef:
  kind: Role
  name: csi:controller:controller
  apiGroup: rbac.authorization.k8s.io
